<?php
/* @var $this EntryController */
/* @var $data Entry */


?>

<div class="view">
<div class="search-form" style="display:none">
<?php 
$model = Entry::model();
$this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div>
	<?php 
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#entry-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
	
	$this->widget('zii.widgets.grid.CGridView', array(
	//'id'=>'entry-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
	
		'code',
		array('name'=>'client_id', 'header'=>'Client', 
		'type'=>'raw',
		  'value'=>'CHtml::link($data->client->name, array("client/view", "id"=>$data->id))'
		) ,
		array('name'=>'port_id', 'header'=>'Port', 'value'=>'$data->port->name'),
		array('name'=>'shipping_line_id', 'header'=>'Shipping Line', 'value'=>'$data->shippingLine->name'),
		
		'customs_entry_no',
		'lodge_date',
		'ETA',
		'selectivity',
		'bill_of_lading_no',

		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>


	

	<hr>
	
	<?php /*
	
	<b><?php echo CHtml::encode($data->getAttributeLabel('code')); ?>:</b>
	<?php echo CHtml::link(CHtml::encode($data->code), array('view', 'id'=>$data->id)); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('client_id')); ?>:</b>
	<?php echo CHtml::encode($data->client->name); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('port_id')); ?>:</b>
	<?php echo CHtml::encode($data->port->name); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('shipping_line_id')); ?>:</b>
	<?php echo CHtml::encode($data->shippingLine->name); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('customs_entry_no')); ?>:</b>
	<?php echo CHtml::encode($data->customs_entry_no); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('lodge_date')); ?>:</b>
	<?php echo CHtml::encode($data->lodge_date); ?>
	<br />
	
	
	<b><?php echo CHtml::encode($data->getAttributeLabel('ETA')); ?>:</b>
	<?php echo CHtml::encode($data->ETA); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('selectivity')); ?>:</b>
	<?php echo CHtml::encode($data->selectivity); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('section')); ?>:</b>
	<?php echo CHtml::encode($data->section); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('arrastre')); ?>:</b>
	<?php echo CHtml::encode($data->arrastre); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('wharfage')); ?>:</b>
	<?php echo CHtml::encode($data->wharfage); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('container_deposit')); ?>:</b>
	<?php echo CHtml::encode($data->container_deposit); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('freight')); ?>:</b>
	<?php echo CHtml::encode($data->freight); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('bill_of_lading_no')); ?>:</b>
	<?php echo CHtml::encode($data->bill_of_lading_no); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('final_assessment')); ?>:</b>
	<?php echo CHtml::encode($data->final_assessment); ?>
	<br />

	*/ ?>

</div>